package com.example.nettyudp;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class NettyudpApplication {

    public static void main(String[] args) throws Exception {
        SpringApplication.run(NettyudpApplication.class, args);
//        //启动服务端
//        NettyServer nettyServer = new NettyServer();
//        nettyServer.start(new InetSocketAddress("192.168.2.128", 9090));
//
//
//        String json = "200";
//        // 由于数据报的数据是以字符数组传的形式存储的，所以传转数据
//        byte[] bytes = json.getBytes("UTF-8");
//        DatagramPacket data = new DatagramPacket(Unpooled.copiedBuffer(bytes), new InetSocketAddress("192.168.2.128", 8899));
//
//        nettyServer.getCh().write(data).sync();
    }

}
